package com.bdqn.repository;

import com.bdqn.entity.User;
import com.bdqn.entity.UserInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

public interface UserRepository extends JpaRepository<User,Long> {

    @Query("select u.usrId as usrId, u.usrName as usrName, u.usrPassword as usrPassword, u.usrRoleId as usrRoleId, u.usrFlag as usrFlag, r.roleName as roleName from User u, Role r where u.usrRoleId= r.roleId and u.usrId=?1")
    public UserInfo getUserInfo(Long usrId);
}
